<extend name="Public/layout"/>

<block name="body">
    <style>
        .modal .row .col-xs-12 {
            padding: 0 !important;
        }

        .nav-tabs-custom > .nav-tabs > li > a {
            padding: 10px 30px;
        }

        .modal .close {
            display: block !important;
            margin-right: 15px;
        }

        .modal-body {
            padding: 0 15px;
        }

        .modal .nav-tabs-custom.flat {
            margin-bottom: 0;
        }

        .modal .tab-footer {
            display: none;
        }
    </style>
    <?php $showFieldsConditons=array(1,3);?>
    <style>
        input.form-control[readonly], .form-control[disabled], .form-control[readonly], fieldset[disabled] .form-control, .form-control-readonly {
            background: #ffffff;
            border: none;
            padding-left: 0;
            height: auto;
            resize: none;
        }

        div.form-control-readonly {
            white-space: pre-wrap;
        }

        .datetimepicker table tr td.active:active, .datetimepicker table tr td.active:hover:active, .datetimepicker table tr td.active.disabled:active, .datetimepicker table tr td.active.disabled:hover:active, .datetimepicker table tr td.active.active, .datetimepicker table tr td.active:hover.active, .datetimepicker table tr td.active.disabled.active, .datetimepicker table tr td.active.disabled:hover.active, .datetimepicker table tr td span.active:active, .datetimepicker table tr td span.active:hover:active, .datetimepicker table tr td span.active.disabled:active, .datetimepicker table tr td span.active.disabled:hover:active, .datetimepicker table tr td span.active.active, .datetimepicker table tr td span.active:hover.active, .datetimepicker table tr td span.active.disabled.active, .datetimepicker table tr td span.active.disabled:hover.active {
            background-color: #3c8dbc;
            border-radius: 5px;
        }
    </style>
    <div class="row js-form-box" id="{$widgetId}">
        <form class="form-horizontal" action="{:U('add_num')}" method="post" id="data_form"
              autocomplete="off">
            <div class="col-xs-12">
                <div class="nav-tabs-custom flat">
                    <div class="tab-content no-padding">
                        <div class='tab-pane active' id="tab{$key}">
                            <div class="box-body" style="max-width:1000px;">

                                <div class="form-group">
                                    <label class="col-sm-2 control-label" data-name="username">会员用户名：</label>
                                    <div class="col-sm-10">
                                        <input type="text" class="form-control" id="username" name="username" style="width:200px;">
                                    </div>
                                </div>
                                
                                <div class="form-group">
                                    <label class="col-sm-2 control-label" data-name="real_name">真实姓名：</label>
                                    <div class="col-sm-10">
                                        <input type="text" class="form-control" name="real_name" id="real_name"
                                               value="" style="color:red;" readonly="readonly">
                                    </div>
                                </div>

                                <div class="form-group">
                                    <label class="col-sm-2 control-label" data-name="goods_id">商品：</label>
                                    <div class="col-sm-10">
                                       <select name="goods_id" class="form-control input-sm  select2 list_filter_select" style="width:200px;">
		                                        <option value="0">--请选择商品--</option>
		                                        <foreach name="goods_list" item="row">
		                                           <option value="{:$row['id']}">{:$row['title']}</option>
		                                        </foreach>
                                        </select>
                                    </div>
                                </div>
                                
                                <div class="form-group">
                                    <label class="col-sm-2 control-label" data-name="buy_num">购买数量：</label>
                                    <div class="col-sm-10">
                                        <input type="text" class="form-control" id="buy_num" name="buy_num" style="width:200px;">
                                    </div>
                                </div>

                                
                                    <button type="submit" class="btn btn-flat _dt_btns_ btn-default" 
                                    data-callback="form" data-param="" style="margin-left:200px;">提交</button>
                                </div>

                                
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </form>
    </div>

    <script>
    
        $(function () {
            $("#username").blur(function(){
            	 var username = $("#username").val();
            	$.post("{:U('getRealName')}",{username:username},function(result){
            		 if(result.result){
            			$("#real_name").val(result.result);
            		}else{
            			$("#real_name").val('用户名不存在');
            		} 
            	    
            	  });  
            });
            
           
             
            
        });
    </script>
</block>